{% from 'bootstrap4/utils.html' import render_messages %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="{{ url_for('static', filename='Classic.ico') }}" type="image/x-icon" >
    {% block head %}
    {% endblock %}
    <title>{% block title %} {% endblock %}</title>
    {{ bootstrap.load_css() }}
    
</head>
<body>
  {% block nav %}
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
      <a class="navbar-brand" href="#">李娜的Python博客</a>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">
          <li class="nav-item active">
            <a class="nav-link" href="{{ url_for('main.index') }}">主页 <span class="sr-only">(current)</span></a>
          </li>
          {% if current_user.is_authenticated %}
          <li class="nav-item">
            <a class="nav-link" href="{{ url_for('main.user',username=current_user.username) }}">用户资料</a>
          </li>
          {% endif %}
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
              Dropdown
            </a>
            <div class="dropdown-menu" aria-labelledby="navbarDropdown">
              <a class="dropdown-item" href="#">Action</a>
              <a class="dropdown-item" href="#">Another action</a>
              <div class="dropdown-divider"></div>
              <a class="dropdown-item" href="#">Something else here</a>
            </div>
          </li>
          <li class="nav-item">
            <a class="nav-link disabled" href="#">Disabled</a>
          </li>
           
            {% if current_user.can(Permission.MODERATE) %}
            <li class="nav-item"><a href="{{ url_for('main.moderate') }}">Moderate Comments</a></li>
             {% endif %}
         
        </ul>       
        {% if current_user.is_authenticated %}
         
        
        <div class="btn-group">
          <button type="button" class="btn btn-outline-success" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
              {{ current_user.username }}
          </button>
          <div class="dropdown-menu">
            <a class="dropdown-item" href="{{ url_for('main.edit_profile') }}">修改个资料</a>
            <a class="dropdown-item" href="{{ url_for('auth.change_password') }}">修改密码</a>
            <a class="dropdown-item" href="{{ url_for('auth.change_email_request') }}">修改电子邮件地址</a>
          <!--<a class="dropdown-item" href="{{ url_for('auth.password_reset_request') }}">重置你的密码</a>-->  
            <div class="dropdown-divider"></div>
            
            <a class="dropdown-item" href="{{ url_for('auth.logout') }}">退出</a>
          </div>
        </div>
         {% else %}
         <a href="{{ url_for('auth.login') }}" class="btn btn-outline-success" tabindex="-1" role="button" aria-disabled="true">登录</a>
        {% endif %}
      </div>
    </nav>
    {% endblock %}

    {{ render_messages(container=False, dismissible=True) }}

    {% block content %}
     <div class="container">
         {% block page_content %}{% endblock %}
     </div>
    {% endblock %}  
    {{ bootstrap.load_js()}}
 
</body>
{% block scripts %}

{{ moment.include_moment() }}
{{ moment.locale('zh-cn')}}
{% endblock %}
</html>


        

    
